Skip to content

Structured outputs #463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: next
Choose a base branch
from
Open

Structured outputs #463

wants to merge 5 commits into from

Conversation

damo
Copy link
Contributor

@damo damo commented May 5, 2025

Includes optional local JSON schema validation and draft SDK documentation.

@damo damo requested a review from a team as a code owner May 5, 2025 15:44
@damo damo force-pushed the damo/structured-outputs branch from 8c0d60a to 67381ff Compare May 7, 2025 10:32
}
```

Pass the top-level class—`BookList` in this example—to `responseFormat(Class<T>)` when building the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Pass the top-level class—`BookList` in this exampleto `responseFormat(Class<T>)` when building the
Pass the top-level class—`BookList` in this example to `responseFormat(Class<T>)` when building the

List<String> books = new ArrayList<>();

StructuredChatCompletionCreateParams<BookList> params = ChatCompletionCreateParams.builder()
.responseFormat(books.class)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.responseFormat(books.class)
.responseFormat(books.getClass())

(the previous code wouldn't have compiled)

```java
List<String> books = new ArrayList<>();

StructuredChatCompletionCreateParams<BookList> params = ChatCompletionCreateParams.builder()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
StructuredChatCompletionCreateParams<BookList> params = ChatCompletionCreateParams.builder()
StructuredChatCompletionCreateParams<List<String>> params = ChatCompletionCreateParams.builder()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants